import java.util.Arrays;
import java.util.Scanner;

public class Main1 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int all = 2 * n;
		int[] nums = new int[all];
		int[] cheng = new int[nums.length];
		
		for(int i = 0 ; i < all ; i++){
			nums[i] = scanner.nextInt();
		}
		Arrays.sort(nums);
		for(int i = 0 ; i < nums.length ; i++){
			cheng[i] = nums[i] * nums[nums.length-i-1];
		}
		Arrays.sort(cheng);
		int result = cheng[0] + cheng[1];
		System.out.print(result);
	}
}
//
//